<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-18 22:33:04
 * @LastEditTime: 2022-02-18 23:13:01
 * @LastEditors: CHINAKAIYUAN
 * @Description: 
 */

namespace App\Models;

class DicCategory extends BaseModel
{
    //
    public $table = "basedata_dic_category";
    protected $guarded = [];
    public function childrenself()
    {
        return $this->hasMany(get_class($this), 'parent_id', 'id');
    }
    public function children()
    {
        return $this->childrenself()->with("children");
    }
    public function dic()
    {
        return $this->hasMany(Dic::class);
    }
}
